# -*- coding: utf-8 -*-
# created by Src - 一路好时光

f=open("联系人.txt","r+",encoding="utf-8")
print(f.readline())

#不加编码时报错
# Traceback (most recent call last):
#   File "E:\PycharmProjects\pythonProject\day4-用Python处理文件\09-file-rw-mode混合模式.py", line 5, in <module>
#     print(f.readline())
#           ^^^^^^^^^^^^
# UnicodeDecodeError: 'gbk' codec can't decode byte 0xbb in position 11: illegal multibyte sequence

print(f.tell())#读取文件当前位置40  r读的光标
f.seek(f.tell())# w写的光标位置从40开始
f.write("又来了一个人")
